import { useState } from "react"

type StatusType = "idle" | "loading" | "success" | "error";
export default function Count(){
    const [count, setCount]=useState<number>(0)
    const [status, setStatus] = useState<StatusType>("idle");
    return (
        <div>
            <h1>Count:{count} {status}</h1>
            <button onClick={()=>setCount(count+1)}>+1</button>
            <button onClick={()=>setStatus('success')}>改变状态</button>
        </div>
    )
}